import 'package:xbaistack/widget/group_setting.dart';
import 'package:flutter/material.dart';

import '../widget/icon_list.dart';

class SettingsPage extends StatefulWidget {
  const SettingsPage({super.key});

  @override
  State<SettingsPage> createState() => _SettingsPageState();
}

class _SettingsPageState extends State<SettingsPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('settings page')),
      body: GroupSetting(
        children: <Item>[
          Item.customize(
            Container(
              height: 100,
              color: Colors.blue,
              child: const Text('测试布局'),
            ),
          ),
          Item.spacer(10),
          Item.leading('fasdf'),
          Item.text(
            title: '账号和测试',
            description: '测试描述',
            subtitle: '二级标题',
            icon: Icon(Icons.abc),
          ),
          Item.input(
            title: '账号和测试',
            value: '313131',
            onChanged: (value) {
              print('value改变: $value');
            },
          ),
          Item.switcher(
            title: '账号和测试',
            subtitle: '二级标题',
            icon: Icon(IconFonts.heart, size: 30),
            value: true,
            onChanged: (value) {
              print('value: $value');
            },
          ),
        ],
      ),
    );
  }
}
